﻿using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;

namespace MyVideoTek
{

    internal class Release
    {

        private JObject __jobject;
        public Release(JObject obj)
        {
            this.__jobject = obj;
        }

        public string ReleaseDate
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "releaseDate"));
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Country _country;
        public Country Country
        {
            get
            {
                if(_country == null)
                    _country = JsonClassHelper.ReadStronglyTypedObject<Country>(JsonClassHelper.GetJToken<JObject>(__jobject, "country"));
                return _country;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private ReleaseState _releaseState;
        public ReleaseState ReleaseState
        {
            get
            {
                if(_releaseState == null)
                    _releaseState = JsonClassHelper.ReadStronglyTypedObject<ReleaseState>(JsonClassHelper.GetJToken<JObject>(__jobject, "releaseState"));
                return _releaseState;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Distributor _distributor;
        public Distributor Distributor
        {
            get
            {
                if(_distributor == null)
                    _distributor = JsonClassHelper.ReadStronglyTypedObject<Distributor>(JsonClassHelper.GetJToken<JObject>(__jobject, "distributor"));
                return _distributor;
            }
        }

    }
}
